//
//  FamilyChangCell.m
//  AILock
//
//  Created by 谭亚明 on 2020/7/2.
//  Copyright © 2020 tym. All rights reserved.
//

#import "FamilyChangCell.h"
#import "UserModel.h"
#import "UIImageView+YPImage.h"
#import "FamilyModel.h"
@implementation FamilyChangCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.headImage.layer.masksToBounds = YES;
    self.headImage.layer.cornerRadius = self.headImage.frame.size.height/2;
    
}


-(void)setFamilyModel:(FamilyModel *)familyModel{
    _familyModel = familyModel;
    _nameLab.text = familyModel.familyName;
    
    if (familyModel.familyId == [UserTool getCurrentFamily].familyId) {
        _currentLab.hidden = NO;
        _rightImage.image = [UIImage imageNamed:@"icon_home12"];
    }else{
        _currentLab.hidden = YES;
        _rightImage.image = [UIImage imageNamed:@"icon_home13"];
    }
    
    if (familyModel.image.length) {
        [self.headImage yp_setImageUlr:[familyModel getFamileHeadImage]];
    }
}

-(void)setEquipMode:(EquipmentUserModel *)equipMode{
    
     _nameLab.text = equipMode.userName;
    _currentLab.text = equipMode.equipmentUserName;
    
    if(equipMode.isSele){
        _rightImage.image = [UIImage imageNamed:@"icon_home12"];
    }else{
        _rightImage.image = [UIImage imageNamed:@"icon_home13"];
    }
    
    if (equipMode.headImgUrl.length) {
        [self.headImage yp_setImageUlr:[equipMode getEquipmentUserImage]];
    }
}

+(CGFloat)cellForHeight{
    return 60;
}

+(NSString*)identifier{
    return @"FamilyChangCell";
}


@end
